<?php

class Application_Model_DbTable_AgentCompany extends Application_Model_DbTable_DomainObject {

    protected $_name = 'uuch_agentcompany';

    public function getMapper() {
        return array('id', 'name', 'host', 'username', 'password');
    }

    public function getEffectivelyAgent() {
        $db = $this->getAdapter();
        $filter = $db->quoteInto(' host != ?', null);
        $filter .= $db->quoteInto(' and username !=?', null);
        $filter .= $db->quoteInto(' and password !=?', null);
        $rows = $this->fetchAll($filter);
        $result = array();
        foreach ($rows as $row)
            array_push($result, $this->convertRowToObject($row));
        return $result;
    }

}